package com.reggie.employee.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;

@Data
public class Employee implements Serializable {

    private static final long serialVersionUID = 1L;

    private Long id;        //Long值太长了导致无法精准的传入js，所以需要格式转换，直接上网搜格式转换的代码即可

    private String username;

    private String name;

    private String password;

    private Long phone;

    private Integer sex;

    private Long idNumber; //驼峰命名法 ---> 映射的字段名为 id_number

    private Integer status;

    private LocalDateTime createTime;

    private LocalDateTime updateTime;

    //这个注解指的是在什么时候向数据库插入新数据,要配合自动注入的类来实现，我这里使用了AutoFill类进行配合
    @TableField(fill = FieldFill.INSERT)
    private Long createUser;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Long updateUser;
}
